#include "Train.h"

class Solution {
public:
    bool Is_vowel(char x)
    {
        if (x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u') 
            return true;
        return false;
    }
    int maxVowels(string s, int k) {
        int l = 0, r = 0;
        int res = 0, ans = 0;
        while (r < s.length())
        {
            if (Is_vowel(s[r++])) ans++;
            while(r - l + 1 > k)
            {
                if(Is_vowel(s[l++])) ans--;
            }
            if (r - l + 1 == k) {
                res = max(res, ans);
            }
            r++;
        }
        return res;
    }
};